import request from '/@/utils/request'
// 查询传感器和角色列表
export function listSensorRole(query:object) {
  return request({
    url: '/api/v1/system/sensorRole/list',
    method: 'get',
    params: query
  })
}
// 查询传感器和角色详细
export function getSensorRole(id:number) {
  return request({
    url: '/api/v1/system/sensorRole/get',
    method: 'get',
    params: {
      id: id.toString()
    }
  })
}
// 新增传感器和角色
export function addSensorRole(data:object) {
  return request({
    url: '/api/v1/system/sensorRole/add',
    method: 'post',
    data: data
  })
}
// 修改传感器和角色
export function updateSensorRole(data:object) {
  return request({
    url: '/api/v1/system/sensorRole/edit',
    method: 'put',
    data: data
  })
}
// 删除传感器和角色
export function delSensorRole(ids:number[]) {
  return request({
    url: '/api/v1/system/sensorRole/delete',
    method: 'delete',
    data:{
      ids:ids
    }
  })
}
// 关联sensors表选项
export function listSensors(query:object){
   return request({
     url: '/api/v1/system/sensors/list',
     method: 'get',
     params: query
   })
}
// 关联sys_role表选项
export function listSysRole(query:object){
   return request({
     url: '/api/v1/system/sysRole/list',
     method: 'get',
     params: query
   })
}
